package org.groupg.practice.document;

import java.io.Serializable;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

public class BusinessDocument implements Serializable {
    private String id;
    private String type; // 业务对象类型
    private Map<String, Object> metrics = new ConcurrentHashMap<>();
    private long version = 0; // 乐观锁版本

    public BusinessDocument(String id, String type) {
        this.id = id;
        this.type = type;
    }

    // Getters & Setters
    public String getId() { return id; }
    public String getType() { return type; }
    public Map<String, Object> getMetrics() { return metrics; }
    public long getVersion() { return version; }
    public void incrementVersion() { version++; }
}